package com.smartcommunity.dao.camera;

import com.smartcommunity.bean.entity.Camera;
import com.smartcommunity.entity.village.SixStatisticsEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Author: JiangM
 * @Date: 2018/1/20
 * @Description: 摄像机DAO层
 * @Modified By:
 */
@Mapper
public interface CameraDao {
    /**
     * 按摄像机类型获得摄像机的数量属性及类型属性(用于实有安防设备柱状图使用)
     *
     * @param map
     * @return
     */
    List<Camera> getCamera (Map<String, Object> map);

    List<SixStatisticsEntity> cameraCountGroupByVillage();

    /**
     * 获得摄像机设备的列表
     *
     * @param map
     * @return
     */
    List<Camera> getCameraList (Map<String, Object> map);


    /**
     * 根据小区编号删除相机
     * @param villageCode
     */
    void deleteCameraByVillageCode (@Param("villageCode") String villageCode);

    /**
     * 获取小区下面的设备
     * @param villageCode
     * @return
     */
    List<Camera> getCameraLists(String villageCode);

    /**
     * 检查小区下是否有设备信息
     * @param villageCode
     * @return
     */
    List<Camera> checkHaveCameraInVillage(@Param("villageCode") String villageCode,@Param("cameraType") Integer cameraType,@Param("source") String source);

    /**
     * 检查小区下是否有设备信息
     * @param villageCode
     * @return
     */
    List<Camera> listCameraInVillage(@Param("villageCode") String villageCode,@Param("cameraType") Integer cameraType,@Param("source") String source);

    Integer getCameraCount();

    Integer getCameraCountByType(Integer cameraType);
}
